Devices, systems, and methods for classifying materials based on a bidirectional reflectance distribution function

ABSTRACT

Systems, devices, and methods for classifying a sample by material type measure a reflection of a sample at an illumination angle and an observation angle in at least two spectral bands, calculate a feature value for the sample based on an estimated ratio value of the at least two spectral bands of the measured reflection, and classify the sample based on the feature value.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority to U.S. Provisional Application No. 61/844,797, which was filed on Jul. 10, 2013.

BACKGROUND Technical Field

This description generally relates to material classification.

BACKGROUND

The classification of materials (e.g., metal, plastic, ceramic, fabric, paint) may be useful in many research and industrial applications, such as remote sensing, food inspection, mineralogy, and recycling. However, some techniques that classify materials require physical contact with the sample, which can limit the applications that these techniques can be used for. The optical classification of materials in a sample may be useful in applications where contact is not possible. Also, the optical classification of materials in a sample may simplify the design of devices and systems that could also use contact to classify the materials.

SUMMARY

In one embodiment, a method for classifying a sample by material type comprises measuring a reflection of a sample at an illumination angle and an observation angle in at least two spectral bands, calculating a feature value for the sample based on an estimated ratio value of the at least two spectral bands of the measured reflection, and classifying the sample based on the feature value.

In one embodiment, a system for classifying a sample by material type comprises one or more computer-readable media; and one or more processors that are coupled to the one or more computer-readable media and that are configured to cause the system to measure a reflection of a sample at an illumination angle and an observation angle in at least two spectral bands, calculate a feature value for the sample based on an estimated ratio value of the at least two spectral bands of the reflection of the sample, and classify the sample based on the feature value.

In one embodiment, a method of classifying a sample by material type comprises capturing an image of a sample at an observation angle, wherein the sample is illuminated at an illumination angle in at least two spectral bands; measuring a respective reflection for each of a plurality of pixels in the image of the sample; calculating a respective feature value for each pixel based on a ratio value, wherein the ratio value is based on the at least two spectral bands of the reflection of the pixel; and classifying the sample based on the feature values.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an example embodiment of a system for material identification and the flow of operations in the system.

FIG. 2 illustrates the unit vectors and angles used in the description of a bidirectional reflectance distribution function (BRDF).

FIG. 3 illustrates examples of the Fresnel reflectance for several metals.

FIGS. 4A, 4B, and 4C illustrate plots of different features against the cosine of the incident angle u.

FIGS. 5A and 5B illustrate examples of two-dimensional material-feature spaces.

FIG. 6 illustrates an example of a three-dimensional material-feature space.

FIG. 7 illustrates an example of a two-dimensional material-feature space.

FIG. 8 illustrates an example embodiment of a multi-channel projector.

FIG. 9A illustrates an example of the sampling angular range for illumination.

FIG. 9B illustrates an example of the sampling angular range for observation.

FIG. 10A illustrates an example embodiment of a reflectance map.

FIG. 10B illustrates an example embodiment of a mask that corresponds to a threshold.

FIG. 11 illustrates an example embodiment in which the resolution of a camera is high enough to resolve the highest spatial frequency of a projected pattern.

FIG. 12 illustrates an example embodiment in which the resolution of a camera is not high enough to resolve the highest spatial frequency of a projected pattern.

FIG. 13 illustrates an example embodiment of an operational flow for classifying materials.

FIG. 14 illustrates an example embodiment of an operational flow for classifying materials.

FIG. 15 illustrates an example embodiment of an operational flow for classifying materials.

FIG. 16 illustrates an example embodiment of an operational flow for generating a reflectance map.

FIG. 17 illustrates an example embodiment of a second mask.

FIG. 18 illustrates an example of an incident angle.

FIGS. 19A and 19B illustrate examples of two-dimensional projections of a three-dimensional material-feature space.

FIG. 20 illustrates an example embodiment of an operational flow for classifying materials.

FIG. 21 illustrates an example embodiment of an arrangement of a camera and a projector.

FIG. 22 illustrates examples of feature-value measurements for aluminum and chromium.

FIG. 23 illustrates the positions that are used to calculate an incident angle.

FIG. 24 illustrates an example embodiment of an operational flow for classifying materials.

FIG. 25 illustrates an example embodiment of an operational flow for classifying materials.

DESCRIPTION

The following disclosure describes certain explanatory embodiments. Other embodiments may include alternatives, equivalents, and modifications. Additionally, the explanatory embodiments may include several novel aspects, and a particular aspect may not be essential to some embodiments of the devices, systems, and methods described herein.

FIG. 1 illustrates an example embodiment of a system for material identification and the flow of operations in the system. The system includes a camera 110 (e.g., a multi-spectral camera 110), a projector 120 (e.g., a multi-channel projector 120), a computing device 135 that includes a material-identification module 130, and a material database 140. Modules include logic, computer-readable data, or computer-executable instructions, and may be implemented in software (e.g., Assembly, C, C++, C#, Java, BASIC, Perl, Visual Basic), hardware (e.g., customized circuitry), and a combination of software and hardware. In some embodiments, the system includes one or more additional modules or the module is divided into more modules. Though the computing device or computing devices that execute a module perform the operations, for purposes of description a module may be described as performing one or more operations.

The projector 120 illuminates a material sample 100 with light, and the camera 110 generates one or more captured images 105 (e.g., measured reflections 105) by detecting light that is emitted by the projector 120 and that is reflected by the material sample 100. The measured reflections 105 include measured reflections in two or more spectral bands and may be mostly specular reflections. The camera 110 sends the measured reflections 105 to a material identification module 130, which is being implemented by a computing device 135. The material identification module 130 obtains material-reflectance information 143 from a material database 140, which stores material-reflectance information 143 for different materials. Based on the measured reflections 105 and on the material-reflectance information 143, the material-identification module 130 generates a material classification 133 that indicates the material of the material sample 100.

The material-identification module 130 may generate the material classification 133 based on a bidirectional reflectance distribution function (BRDF), which describes the optical response (i.e., the reflection) of a material to incident light from different directions. Because the BRDF is a four-dimensional function of illumination (solid) angle and observation (solid) angle, typically only slices of it are measured, and a classifier is computed from these slices.

For example, some techniques construct a feature-value vector using 27 coefficients of a hemispherical harmonic series based on 64 BRDF slices (each slice requiring one capture, resulting in 64 captures) and a classifier (e.g., a support vector machine (SVM) classifier). These techniques also make corrections to the BRDF slices to account for the spatial variations of the surface normal. Also, some techniques, which require only two captures, do not recover the 150-dimensional feature-value vector, but instead optically capture the classifier (e.g., SVM classifier) directly. However, they require the surface normal to be spatially constant and known (e.g., pointing upwards). Additionally, some techniques assume a radiance model with two “KG” product terms, where the “K” term depends only on intrinsic material properties (e.g., diffuse and specular albedos, refractive index, surface roughness) and the “G” term depends only on the observation/illumination geometry and object shape, but not on the intrinsic material properties. These techniques generate a geometry invariant as a ratio of two determinants based on six measurements.

While these techniques require a large number of captures or limit the shapes of material samples (e.g., flat material samples), these techniques also construct a feature space directly from the BRDF slices. BRDF does not depend only on the material, but also on the surface condition. For example, for the same metal (e.g., aluminum), different surface finishes will result in different BRDFs. A smooth, mirror-like metal surface has a BRDF that is concentrated along the specular directions (i.e., looks like a delta function). A metal surface that is rough may behave more like a Lambertian surface (i.e., the BRDF is constant for all illumination angles and all observation angles).

For example, consider a rather general model of a BRDF. FIG. 2 illustrates the unit vectors and angles used in the description of a BRDF. N is a surface-unit-normal vector, T is a reference-unit-tangent vector, L is an illumination-direction (lighting direction) unit vector, V is an observation-direction (viewing direction) unit vector, and H is a half-way vector. The half-way vector H, which is a unit vector, may be defined according to the following:

$\begin{matrix} {H = {\frac{L + V}{{L + V}}.}} & (1) \end{matrix}$

H₀ is the projection of H onto the tangent plane. Also, it is convenient to express the angles in terms of their cosines, or equivalently, in terms of dot products of vectors:

t=H·N

u=H·V

v=V·N

l=L·N

w=T·H ₀ /∥H ₀∥  (2)

A general BRDF model is given by the following equation:

$\begin{matrix} {{{R_{\lambda}\left( {L,V} \right)} = {{\frac{d(m)}{\pi}C_{\lambda}} + {\frac{s(m)}{4\pi \; v\; }{F_{\lambda}(u)}{G\left( {t,u,v,,w,m} \right)}{D\left( {t,m} \right)}}}},} & (3) \end{matrix}$

where d(m)+s(m)=1, where λ denotes wavelength, where m is a roughness parameter (e.g., describing the surface finishing of a metal sample), where t is the cosine of α, where u is the cosine of the half-angle β, where v is the cosine of θ_(v), where l is the cosine of θ_(L), and where w is the cosine of φ. However, this BRDF model is presented for illustrative purposes, and some embodiments of the systems, devices, and methods use other models instead of this model. The first term on the right side describes the diffuse reflection, where C_(λ) is the spectral reflectance, while the second term on the right side describes the specular reflection. The physical origin of these terms may be different for different material types (e.g., metals and dielectrics have different physics of reflection). For metals, for example, specular reflection is a result of the scattering of light by moving electrons on the metal surface, and there is no subsurface phenomenon. The factors d(m) and s(m) describe the relative amounts of diffuse reflection and specular reflection, which depend on the roughness m of the surface.

A metal surface can be modeled by a microfacet model, which postulates a distribution of microscopic mirrors, or microfacets. Using this model, the diffuse reflection term (the first term in equation (3)) may arise from interreflections among the microfacets. Additionally, the specular reflection term (the second term in equation (3)) is composed of several factors. F_(λ)(u) describes the Fresnel reflectance, which represents the reflectance of a perfect metallic mirror. The Fresnel reflectance F_(λ)(U) is the only term that depends on wavelength λ. Also, the Fresnel reflectance F_(λ)(u) depends on the incident angle, or equivalently the cosine of the incident angle, denoted by u. According to the microfacet model, specular reflection only happens for the microfacets whose (microscopic) normal aligns with the half-way vector. The proportion of such microfacets is determined by the distribution function D (t, m). Typically, this distribution is concentrated around t=0, when the half-way vector coincides with the macroscopic normal N. As roughness m increases, the distribution function D (t, m) spreads out, producing less pronounced specular reflection and a larger specular lobe for the BRDF. In many BRDF models, such as the Cook-Torrance model, the roughness m indicates the RMS slope of the microfacets. Finally, the geometric attenuation term G (t, u, v, l, w, m) indicates the masking and shadowing effects among the microfacets.

Thus, the Fresnel reflectance F_(λ)(u) is the only component of the BRDF that contains information intrinsic to the material. The other terms describe the effect of roughness m on the BRDF. Following are specific forms of the geometric-attenuation term and the microfacet-slope-distribution function for the Cook-Torrance BRDF model. These forms are provided only as examples; the example embodiments of systems, devices, and methods described herein do not assume any specific BRDF model other than the general model given by equation (3). Additionally, the techniques for calculating the feature value may work for BRDF models that are more general than the general model described by equation (3). The geometric-attenuation term for the Cook-Torrance isotropic BRDF model is given by the following:

$\begin{matrix} {{G\left( {t,u,v,,w,m} \right)} = {{\min \left( {1,{2\frac{tv}{u}},{2\frac{t\; }{u}}} \right)}.}} & (4) \end{matrix}$

Independence of this term on the cosine of the azimuthal angle w signifies isotropy. Independence from roughness m may be considered an inadequacy of the Cook-Torrance model. The microfacet-slope-distribution function is given by the Beckmann distribution function:

$\begin{matrix} {{D\left( {t,m} \right)} = {\frac{1}{m^{2}t^{2}}{^{\frac{t^{2} - 1}{m^{2}t^{2}}}.}}} & (5) \end{matrix}$

Also, the Fresnel reflectance F_(λ)(u) is well understood. For metals, it is based on the refractive index n_(λ) and the extinction coefficient k_(λ), both of which depend on the wavelength λ. For non-polarized light,

$\begin{matrix} {{{{F_{\lambda}(u)} = {\frac{1}{2}{\frac{\left( {a - u} \right)^{2} + b^{2}}{\left( {a + u} \right)^{2} + b^{2}}\left\lbrack {\frac{\left( {a + u - u^{- 1}} \right)^{2} + b^{2}}{\left( {a - u + u^{- 1}} \right)^{2} + b^{2}} + 1} \right\rbrack}}},{a^{2} = {\frac{1}{2}\left( {\sqrt{\left( {n_{\lambda}^{2} - k_{\lambda}^{2} + u^{2} - 1} \right)^{2} + {4\; n_{\lambda}^{2}k_{\lambda}^{2}}} + n_{\lambda}^{2} - k_{\lambda}^{2} + u^{2} - 1} \right)}},{and}}{b^{2} = {\frac{1}{2}{\left( {\sqrt{\left( {n_{\lambda}^{2} - k_{\lambda}^{2} + u^{2} - 1} \right)^{2} + {4\; n_{\lambda}^{2}k_{\lambda}^{2}}} - n_{\lambda}^{2} + k_{\lambda}^{2} - u^{2} + 1} \right).}}}} & (6) \end{matrix}$

FIG. 3 illustrates examples of the Fresnel reflectance F_(λ)(u) for several metals. FIG. 3 indicates that with a full tabulation of the Fresnel reflectance F_(λ)(u) over the space of the cosine of the half angle u and of the wavelength λ, it is possible to classify or differentiate different metals. For example, a minimum reflectance for aluminum occurs at a wavelength of 816 nm and an incident angle of 83° (this incident angle's cosine u is 0.12). The wavelength λ is in the near infrared range (NIR), but is a characteristic of aluminum.

However, isolating the Fresnel reflectance F_(λ)(u) in the right side of equation (3) using BRDF measurements (the left side of equation (3)) is not straightforward. Nevertheless, embodiments of the system isolate a material feature that depends on the Fresnel reflectance F_(λ)(u) (e.g., a ratio of Fresnel reflectances F_(λ)(u)), even though it may not be the Fresnel reflectance F_(λ)(u) itself. For example, the wavelength dependence of the Fresnel reflectance F_(λ)(u) for different metals allows the system to use the material feature that depends on the Fresnel reflectance F_(λ)(U) to classify or differentiate the metals. In some embodiments, a material feature is a ratio of two measurements (e.g., measured reflections in two spectral bands) at a specular pixel.

In some example embodiments, the BRDF is measured in multiple spectral bands, for example N spectral bands, which generates a sampling of the BRDF at multiple illumination-angle/observation-angle combinations, for example M combinations, thereby producing the following measurements: R_(i)(L_(j),V_(j)); i=1, 2, . . . , N; j=1, 2, . . . , M.

A description of the choice of illumination/observation angle pairs (L_(j), V_(j)); j=1, 2, . . . , M, which are the sampling locations of the BRDF, is presented below. Note however that there is not a strict assumption about this sampling, such as uniform sampling. In some embodiments, the sampling is very sparse. Furthermore, in practice the illumination and observation angles may not be completely controllable because, in addition to depending on the location of the light source and the camera, the illumination and observation angles also depend on the shape of the sample being observed. In particular, the unit vectors L_(j) and V_(j) also depend on the surface normal vector of the sample, which in general may be unknown and which may also vary spatially.

Additionally, a spectral band can be a single wavelength λ_(i), for which R_(i)(L_(i), V_(j))=R_(λ) _(i) (L_(j),V_(j)), or a spectral band can also be a broadband that includes multiple wavelengths. In these broadband embodiments, the BRDF measurements may be assumed to use “white light” as light source and a camera with a broadband sensitivity s_(i)(λ). If the power spectrum of the light source is flat or is approximately flat, then R_(i)(L_(j),V_(j))=∫₀ ^(∞)R_(λ)(L_(j),V_(j))s_(i)(λ)dλ.

Moreover, some embodiments restrict measurements to measurements where the specular component dominates the diffuse component in order to make isolating the Fresnel reflectance F_(λ)(u) easier. These restrictions can be implemented through the selection of the illumination and the camera. Some embodiments implement a homogeneous function χ(x₁, x₂, . . . , x_(N)) of degree zero on the Nmeasurements. Mathematically, a homogenous function of degree zero in N variables satisfies the following property: χ(σx₁, σx₂, . . . , σx_(N))=χ(x₁, x₂, . . . , x_(N)) for any number σ.

Equation (3) and the assumption that the specular component dominates the diffuse component lead to

χ(R ₁(L _(j) ,V _(j)), . . . , R _(N)(L _(j) ,V _(j))≈χ(F ₁(u _(j)), . . . , F _(N)(u _(j))),  (7)

where F_(i)(u_(j))=F_(λ) _(i) (u_(j)) in the case of a single-wavelength spectral band, and where F_(i)(u_(j))=∫₀ ^(∞)F_(λ)(u_(j))s_(i)(λ)dλ for a broadband spectral band. Equation (7) leads to a material-feature value (also referred to herein as a “feature value”) for each illumination-observation pair (L_(j), V_(j)), and each illumination-observation pair (L_(j), V_(j)) gives a corresponding cosine of half angle u_(j). The dependency of the Fresnel reflectance F_(λ)(u) on the incident angle is very small, especially away from grazing angles (incident angles close to 90°). As a result, the material-feature values for multiple illumination-observation angles form clusters that are characteristic of respective metals, which enables the discrimination of different metals.

Examples of a homogeneous function of degree zero include the following: First, a ratio of two measurements in different spectral bands (spectral band i and spectral band i′): R_(i)/R_(i′). This quantifies a rate of change of the Fresnel reflectance F_(λ)(u) relative to wavelength λ. For example, if R_(i)/R_(i′)>1, then the Fresnel reflectance F_(λ)(u) increases from band i′ to band i. In this case, the choice of the homogenous function of degree zero is χ(x₁, x₂, . . . , x_(N))=x_(i)/x_(i′).

The second example is a ratio of the measurement in spectral band i′ to the geometric mean of the measurements in spectral bands i and i″: R_(i)′/√{square root over (R_(i)R_(i″))}. This measures a concavity of the Fresnel reflectance F_(λ)(u) relative to wavelength. For example, if R_(i′)/√{square root over (R_(i)R_(i″))}>1, then the dependency on wavelength λ is concave if the spectral bands i, i′, i″ are in ascending order of wavelength λ. In this example, the choice of the homogenous function of degree zero is χ(x₁, x₂, . . . , x_(N))=x_(i′)/√{square root over (x_(i)x_(i″))}.

FIGS. 4A, 4B, and 4C illustrate plots of different material-feature values (e.g., ratios of the measurements in spectral bands) against the cosine of the incident angle u, which show the dependency of the ratio of the Fresnel reflectance F_(λ)(u) at different wavelengths λ on the cosine of the incident angle u. As noted above, for incident angles away from 90°, the curves illustrated by the plots are relatively flat. Also, using only visible wavelengths (FIGS. 4A and 4B), it may be difficult to discriminate aluminum from chromium. The use of the NIR wavelength 816 nm in FIG. 4C improves the discrimination of aluminum and chromium.

Accordingly, some embodiments of the system in FIG. 1 use a high-dimensional material-feature space to discriminate materials. These embodiments may combine multiple features into a higher-dimensional feature space and separate target materials using their respective feature-value vectors. FIGS. 5A and 5B illustrate examples of two-dimensional material-feature spaces, which are defined by different material features, and FIG. 6 illustrates an example of a three-dimensional material-feature space, although high-dimensional feature spaces may include more dimensions. The material-feature values may form per-material clusters in the feature spaces instead of per-material points because of the dependence of the Fresnel reflectance F_(λ)(u) on the incident angle, and thus measurements generated with different incident angles may be different. Using the material features (e.g., the material-feature space that is defined by the two features) in FIG. 5A, it may be difficult to separate aluminum and chromium. However, based on the two material features (e.g., based on the two-dimensional material-feature space that is defined by the two material features) in FIG. 5B or based on the three material features (e.g., based on the three-dimensional material-feature space that is defined by the three material features) in FIG. 6, which both include a material feature generated using NIR BRDF, the difficulty is resolved.

Also, FIG. 7 illustrates an example of a two-dimensional material-feature space. The two-dimensional material-feature space shows a plot of material-feature values that were generated from broadband BRDF measurements generated by an RGB camera.

In the system in FIG. 1, the camera 110 may be a multispectral camera and the projector 120 may be a multi-channel projector, for example as described in U.S. patent application Ser. No. 13/839,292 and U.S. patent application Ser. No. 13/839,457, which are incorporated by reference. Embodiments of the system that include a multispectral camera and a multi-channel projector may perform BRDF sampling that increases the likelihood of inducing a reflection that has a specular component that dominates the diffuse component. These embodiments may use the ratio of measurements in at least two spectral bands as a material-feature value and may use spectral structured light to generate the measurements.

For example, the camera 110 may be a multispectral camera that detects light in at least N channels, and the projector 120 may be a multi-channel projector that emits light in N channels, where N is at least two, and thus these embodiments are capable of measuring a reflection in at least two spectral bands. The number N may further be higher than two to provide sufficient accuracy for estimating a three-dimensional (3D) position map. For example, N=10 may provide a total of 2¹⁰=1024 depth levels.

A multispectral camera can be implemented using, for example, a color filter array (CFA) that generalizes the standard Bayer CFA to more than three colors. A multispectral camera can also be implemented using a color-filter wheel along with a monochrome sensor. Additionally, a color filter can be pigment based, and the polarization state of light passing through such a filter will be unaltered, so that the polarization state of light before and after passing through such a filter remains unknown. Therefore, some embodiments may not capture a polarization property of light.

An exposure setting for the camera 110 may be set so the camera 110 captures mainly the specular reflection. For example, using a relatively short exposure setting, the pixels that detect mostly the specular reflection can capture the specular reflection without overexposure. The pixels that detect mostly a diffuse reflection may be underexposed and may be cropped out or ignored, for example during an image processing procedure during the calculation of material-feature values. Also, some embodiments use a high-dynamic-range (HDR) sensor to capture all pixels, regardless of whether the reflection detected by a particular pixel is mainly specular or diffuse.

Additionally, the multi-channel projector may be configured to have a monochrome wavelength in each channel, for example in N distinct wavelengths: λ₁, λ₂, . . . , λ_(N). Some embodiments of a multi-channel projector use multiple relatively-few-channel (e.g., three- or four-channel) projectors in a co-axial configuration, for example as shown in FIG. 8, which illustrates an example embodiment of a 10-channel projector. The embodiment of the multi-channel projector includes four semi-transparent mirrors 824, a single-channel projector 823, and three three-channel projectors 822, each of which projects light in three wavelengths. For example, a first three-channel projector 822 projects light in the following three wavelengths: λ₁, λ₂, and λ₃. The number of projectors with relatively few channels and the distribution of wavelengths over these projectors may be different in other embodiments.

Furthermore, the channels of a multi-channel projector may be generated by one or more laser light sources, which give the multi-channel projector a very large depth of field and the ability to focus at close distances. For example, four wavelengths of a multi-channel projector may be chosen to be commercially available laser wavelengths: 450 nm, 532 nm, 640 nm, and 808 nm. Also, the 4^(th) channel's wavelength, which is in the NIR range of the spectrum, may be particularly useful for identifying aluminum. Additionally, the laser light sources may not, in general, produce polarized light.

In some embodiments, for example the embodiment illustrated by FIG. 1, the multi-channel projector (an example of a projector 120) is placed relatively close to the material sample 100 and is focused on the material sample 100, while the multispectral camera (an example of a camera 110) is placed relatively far from the material sample 100 and is focused on the material sample 100. Even though the exact directions of the surface normal vectors of the material sample 100 are not known a priori, the arrangement of a long-focus for the camera 110 and short-focus for the projector 120 may increase the likelihood of capturing a specular reflection. By focusing the camera 110 at a longer distance, the viewing angles associated with the camera pixels are within a relatively narrow range. Although the orientations of the surface normal vectors of the material sample 100 are unknown, there is a relatively narrow range of illumination angles for which specular reflection can occur. When using a projector 120 that is focused at a short distance, the sampling angular range for the illumination of the material sample 100 is relatively large. This may increase the chance that the sampling angular range will include the relatively narrow range that is necessary to capture a specular reflection. FIG. 9A illustrates an example of the sampling angular range for illumination, and FIG. 9B illustrates an example of the sampling angular range for observation (e.g., capture). Also, due to the Helmholtz reciprocity of BRDF, the illumination direction and the observation direction are interchangeable. Therefore, some embodiments use a long focus for the projector 120 and a short focus for the camera 110.

Additionally, some embodiments of the system of FIG. 1 use a spectral-structured light system that uses N-bit binary Gray code (e.g., N=10) as the coded pattern for projection. These embodiments can obtain shape and surface normal vectors. In some embodiments, a pattern corresponding to the N-bit binary Gray code pattern and its complementary pattern (which interchanges 0's and 1's in the binary Gray code pattern) are projected in a temporal sequence, thus requiring two image captures to determine the position and surface normal vector of a scene point. The intensity value of a pixel in the two captured images is related to the radiance of reflected light, regardless of its polarization state. Accordingly, some embodiments of the spectral-structured light system do not include a polarizer to distinguish different polarization states of light, and thus the captured images represent a total radiance of reflected light in all polarization states.

In some embodiments, the wavelengths in the channels of the projector 120 are arranged in a way that depends on how high the spatial frequencies that the camera 110 can reasonably resolve are. In the following paragraphs, the lowest channel number corresponds to the highest spatial frequency, the second-lowest channel number corresponds to the next highest spatial frequency, and so on. In some embodiments, the four wavelengths 450 nm, 532 nm, 640 nm, and 808 nm do not correspond to the lowest numbered channels in the system. Instead, the channels correspond to the highest spatial frequencies that the camera 110 can reasonably resolve, and thus the choice of the four channels depends on the resolution of the camera 110. For example, Table 1 shows an example where the camera can reasonably resolve the spatial frequencies of channel 3 and the higher-numbered channels (this description assumes that the spatial frequencies of the projected patterns decrease as the projector channel number increases):

TABLE 1 Projector channel no. 1 2 3 4 5 6 7 8 9 10 Wavelength 375 405 450 532 640 808 473 670 685 705 (nm) In other embodiments, spatial frequencies of the projected patterns may not decrease as the projector channel number increases. For example, in some embodiments, spatial frequencies of the projected patterns increase as the projector channel number increases. More generally, the relationship between the spatial frequencies of the projected patterns and the projector channel numbers may be different than the one assumed in Table 1 by a permutation of the N channels. The arrangement of wavelengths in Table 1 may then be adjusted by the same permutation.

FIG. 11 illustrates an example embodiment in which the resolution of a camera 110 is high enough to resolve the highest spatial frequency of a projector 120, which corresponds to the lowest projector channel number. In this example embodiment, a first binary pattern and a second binary pattern are projected in each projector channel, and the two binary patterns are mutually complementary, or inverse to each other, as for example described in U.S. patent application Ser. No. 13/839,292. As can be seen in FIG. 11, the mutually complementary patterns are well resolved, and the global component of the illumination can be recovered correctly. The global component of the illumination corresponds to indirect reflections, such as interreflections, from light originating from the projector and generally does not contain information about the code in the coded patterns. FIG. 12 illustrates an embodiment where the resolution of the camera is not high enough to resolve the highest spatial frequency in the lowest-numbered projector channel. “Bleeding” can be seen in both of the mutually inverse patterns, and the global component recovered from these patterns has errors.

In some embodiments, the spatial frequency for a spectral band of the coded pattern depends on the channel, and the spatial frequency for one spectral band of the coded pattern is different than the spatial frequency for another spectral band of the coded pattern. For example, in some embodiments, for important spectral bands (e.g., wavelengths), the spatial frequencies for the spectral bands (e.g., wavelengths) are not the higher spatial frequencies. Instead the spatial frequencies for the spectral bands are lower in accordance with the ability of the camera 110 to resolve the coded patterns.

In addition, the two captured images (e.g., measured reflections 105) that correspond to two mutually complementary binary Gray code patterns can, after the removal of interreflections, be combined by the system to form one or more radiance maps I_(λ) _(i) (p) (e.g., a radiance map for each wavelength λ_(i)) of a contiguous region Ω of pixels that correspond to a region on the sample surface, where p∈Ω is a pixel. Through radiometric calibration of the projector 120 (e.g., during an initial setup of the system), the irradiance at pixel p at normal incidence can be predetermined. Correcting for foreshortening using the information about the surface-normal vector at pixel p, the system can generate an incident irradiance map E_(λ) _(i) (p). An estimate of the BRDF at pixel p can be obtained by generating a reflectance map R_(λ)(p), for example according to R_(λ) _(i) (p)=I_(λ) _(i) (p)/E_(λ) _(i) (p). In addition, each pixel p is associated with an illumination-observation angle pair (L_(j), V_(j)) using the information about the intrinsic and extrinsic parameters of the camera 110 and the projector 120, which may be obtained by geometric calibration (e.g., during an initial setup of the system). FIG. 10A illustrates an example embodiment of a reflectance map R_(λ)(p).

Some embodiments use only a sub-region of the contiguous region Ω of the reflectance map R_(λ)(p) that corresponds to the specular reflection, and thus attempt to ignore the diffuse component. A threshold reflectance (and the corresponding mask) may be determined by examining the dynamic range of the reflectance map R_(λ)(p). Then a region that corresponds to the specular reflection is determined by considering only the pixels p that have reflectance values above the determined threshold. FIG. 10B illustrates an example embodiment of a mask that corresponds to a threshold.

The material-identification module 130 may generate a material-feature value for each pixel p in the region that corresponds to the specular reflection. The feature values of the pixels p may, in general, form a cluster (see, e.g., FIG. 7). The system may determine the center of the cluster, after optionally removing any outliers. The system then generates a material-feature value for the cluster, or if multiple features are used, generates respective material-feature vectors for the clusters. The material-identification module 130 can compare these one or more material-feature values or material-feature vectors with the material-feature values or material-feature vectors (which are examples of material-reflectance information 143) of known materials in a material database 140 to generate the material classification 133 for the material sample 100.

FIG. 13 illustrates an example embodiment of an operational flow for classifying materials. The blocks of this operational flow and the other operational flows described herein may be performed by one or more computing devices, for example the systems and devices described herein. Also, although this operational flow and the other operational flows described herein are each presented in a certain order, some embodiments may perform at least some of the operations in different orders than the presented orders. Examples of possible different orderings include concurrent, overlapping, reordered, simultaneous, incremental, and interleaved orderings. Thus, other embodiments of this operational flow and the other operational flows described herein may omit blocks, add blocks, change the order of the blocks, combine blocks, or divide blocks into more blocks.

The flow starts in block 1300, where a reflection (e.g., a specular reflection) of a material sample is measured at an illumination angle and an observation angle in at least two spectral bands, for example by capturing one or more images of the material sample. In some embodiments, measuring the reflection includes generating a measurement of a BRDF function or of a reflected radiance. Next, in block 1310, a ratio value of the at least two spectral bands is calculated. The flow then moves to block 1320, where a material-feature value is generated for the material sample, based on the ratio value. In some embodiments, the material-feature value is also based on a Fresnel reflectance of the sample. The flow then proceeds to block 1330, where a material classification is generated based on the material-feature value and on a database of material-feature values.

FIG. 14 illustrates an example embodiment of an operational flow for classifying materials. The flow starts in block 1400, where multispectral radiance images of a material sample that is illuminated by a coded pattern and an inverse coded pattern in N wavelengths are captured. The flow then moves to block 1405 where interreflections are removed from the multispectral radiance images, for example based on the coded pattern and the inverse coded pattern. For example, for wavelength λ, if the multispectral radiance images for the coded pattern and the inverse coded pattern are respectively I_(λ) ⁽⁰⁾ and I_(λ) ⁽¹⁾, then the interreflection-removed multispectral radiance images may be respectively generated according to Ĩ_(λ) ⁽⁰⁾=I_(λ) ⁽⁰⁾−min(I_(λ) ⁽⁰⁾, I_(λ) ⁽¹⁾) and Ĩ_(λ) ⁽¹⁾=I_(λ) ⁽¹⁾−min (I_(λ) ⁽⁰⁾, I_(λ) ⁽¹⁾)_(λ)). Next, in block 1410, for each wavelength λ, the respective complementary multispectral radiance images (of the coded pattern and the inverse coded pattern) are combined to form one radiance image I_(λ) for the wavelength λ. For example, in some embodiments the radiance image I_(λ) is generated according to I_(λ)=Ĩ_(λ) ⁽⁰⁾+Ĩ_(λ) ⁽¹⁾). The flow then proceeds to block 1415, where a three-dimensional (3D) position map is generated based on the multispectral radiance images, for example multispectral radiance images Ĩ_(λ) ⁽⁰⁾ and Ĩ_(λ) ⁽¹⁾.

Next, in block 1420, a surface-normal vector map is generated based on the three-dimensional position map. The flow then moves to block 1425, where for each wavelength λ, an irradiance map E_(λ) is generated based on the three-dimensional position map and the surface-normal vector map. The flow then proceeds to block 1430 where, for each wavelength λ, a reflectance R_(λ)map is generated based on the radiance images I_(λ) and on the irradiance maps E_(λ), for example according to R_(λ)=I_(λ)/E_(λ).

Next, in block 1435, for each wavelength λ, a dynamic range and a reflectance-threshold value are determined. The flow then moves to block 1440 where, for each wavelength λ, specular pixels that are above the reflectance-threshold value are determined. Following, in block 1445, material-feature vectors are generated for the specular pixels. For example, in some embodiments a material-feature vector is generated for each specular pixel. The flow then moves to block 1450, where a central material-feature vector is determined based on the material-feature vectors. A central material-feature vector may be an average of the material-feature vectors for the specular pixels. A different statistic for central tendency may be used, such as a component-wise median of the material-feature vectors for the specular pixels. Finally, in block 1455, the central material-feature vector is compared with the material-feature vectors in a database of material-feature vectors to determine a material classification.

FIG. 15 illustrates an example embodiment of an operational flow for classifying materials. In block 1500, multispectral radiance images of a material sample that is illuminated by a coded pattern and an inverse coded pattern in N wavelengths λ are captured. In some embodiments, two stacks of mutually complementary images are captured, and each stack includes N images that correspond to the N wavelengths. Next, in block 1510, a reflectance map is generated for each wavelength λ, for example as described in FIG. 16. The flow then moves to block 1520, where a cluster of material-feature vectors is generated based on one or more of the reflectance maps. Finally, in block 1530, respective distances of the cluster (e.g., a centroid of the cluster) of material-feature vectors from reference material-feature vectors are calculated, and the material is classified based on the distance (e.g., the material sample is classified as the material that corresponds to the shortest distance).

FIG. 16 illustrates an example embodiment of an operational flow for generating a reflectance map, for example in block 1510. In block 1600, a position map 1605 is generated based on geometric calibration data for a camera 1601, on geometric calibration data for a projector 1602, and on multispectral radiance images 1604 (which may be the output of block 1500 in FIG. 15). For example a position map 1605 of surface points may be computed from the multispectral radiance images 1604 using information about the locations of the projector and the camera (e.g., from a geometric calibration performed before the system is used) and a method of triangulation, though in some embodiments, the position map 1605 is generated or obtained through different techniques. For example, the position map 1605 may be obtained from another system, such as another structured light system or a photometric stereo system. The position map 1605 may also be available from prior knowledge of the shape of the material sample, for example a material sample that is known to be flat.

Additionally, outside the specular highlight region, the multispectral radiance images 1604 are sometimes very dark, and these areas outside the specular highlight region may be ignored when determining the positions of surface points. To identify pixels in the multispectral radiance images 1604 that are too dark, some embodiments use a threshold τ₀, for example τ₀=0.3, and generate a first mask 1611. For example, if the two mutually complementary stacks of multispectral radiance images 1604 are respectively denoted by {I_(λ) _(i) ⁽⁰⁾}_(i=1, 2, . . . , N) and {I_(λ) _(i) ⁽¹⁾}_(i=1, 2, . . . , N), then the dark pixels are “masked out” using a binary mask M₁ 1611 (an example of the first mask 1611) according to

${M_{1}(p)} = \left\{ {\begin{matrix} 1 & \begin{matrix} {{{{if}\mspace{14mu} {\forall i}} = 1},2,\ldots \mspace{14mu},N,{{I_{\lambda_{i}}^{(0)}(p)} > {{\tau_{0} \cdot \mu_{i}}\mspace{14mu} {or}}}} \\ {{I_{\lambda_{i}}^{(1)}(p)} > {\tau_{0} \cdot \mu_{i}}} \end{matrix} \\ 0 & {otherwise} \end{matrix},} \right.$

where μ_(i)=max_(q) (max(I_(λ) _(i) ⁽⁰⁾) (q), I_(λ) _(i) ⁽¹⁾(q))), and where p is a pixel.

Next, in block 1610, a normal vector map 1606 is generated based on the position map 1605. For example, a surface normal vector map 1606 may be computed from the position map 1605 by fitting local tangent planes. These operations may further increase the number of ignored pixels in the multispectral radiance images 1604 because pixels near the boundary of the region defined by the first mask 1611 would not have enough neighboring pixels for the fitting. Accordingly, these operations may further modify the first mask 1611 to generate a second mask 1612 that is smaller than the first mask 1611 (e.g., has fewer 1's than the first mask). FIG. 17 illustrates an example embodiment of a second mask 1612.

The flow then moves to block 1620, where an irradiance map E_(λ) _(i) 1607, for (i=1, 2, . . . N), is generated based on the normal vector map 1606 and on radiometric calibration data 1603 (e.g., a projector irradiance map E_(λ) _(i) ⁽⁰⁾) for the projector (the radiometric calibration may be performed before the operations in FIG. 16 are performed). For example, for a laser projector, radiometric calibration may produce a projector irradiance map E₈₀ _(i) ⁽⁰⁾(i=1, 2, . . . , N) at normal incidence. Accordingly, at scene points (e.g., points on a surface of a material sample) not too far away from the laser projector, the laser beam exhibits almost no divergence and therefore has constant irradiance at normal incidence (i.e., zero-degree incidence) along a given angle. However, irradiance at a scene point still depends on the incident angle, which is the angle between the surface normal vector and the direction of the projector beam. FIG. 18 illustrates an example of an incident angle θ_(p). The irradiance map E_(λ) _(i) 1607 may be generated according to E_(λ) _(i) (p)=E_(λ) _(i) ⁽⁰⁾(p)cos θ_(p), i=1, 2, . . . , N, where p is a pixel.

Additionally, in block 1630, which may be performed independently of one or more of blocks 1600-1620, a radiance map I_(λ) 1608 is generated based on the multispectral radiance images 1604. Also, each multispectral radiance image 1604 may be illuminated at only approximately half of its pixels due to the coded pattern. The radiance map I_(λ) 1608 may be generated by combining two mutually complementary multispectral radiance images 1604 and correcting any interreflections (the global component). In some embodiments, the radiance map I_(λ) 1608 at wavelength λ_(i) for a pixel p is generated according to the following:

I _(λ) _(i) (p)=I _(λ) _(i) ⁽⁰⁾(p)+I _(λ) _(i) ⁽¹⁾(p)−2 min(I _(λ) _(i) ⁽⁰⁾(p),I _(λ) _(i) ⁽¹⁾(p)).

The above equation may be particularly applicable to channels or wavelengths that correspond to relatively-high spatial frequencies.

Finally, in block 1640, a reflectance map R_(λ) 1609 is generated based on the radiance map I_(λ) _(i) 1608 and on the irradiance map E_(λ) _(i) 1607, for example according to R_(λ) _(i) =I_(λ) _(i) /E_(λ) _(i) .

Referring again to FIG. 15, some embodiments of block 1520, where a cluster of material-feature vectors is generated, include calculating material-feature vectors for specular pixels based on one or more reflectance maps R_(λ). Some embodiments use the second mask 1612 that is generated in FIG. 16 to determine a region Ω of pixels where the reflectance map is valid. However, not every pixel in the region is considered specular: in some embodiments, specular indicates a high reflectance value. Specular pixels may be identified by using another threshold τ₁. For example, in some embodiments τ₁=0.3, and a specular pixel is a pixel in Ω that ranks in the top τ_(i)·100% in reflectance value. Thus, some embodiments identify pixels that rank in the top 30% in reflectance value as specular.

For the identified specular pixels, material-feature vectors are generated. For example, in some embodiments, a material-feature vector is a three-dimensional material-feature vector that includes the following dimensions:

(R ₅₃₂(p)/R ₄₅₀(p),R ₆₄₀(p)/R ₅₃₂(p),R ₈₀₈(p)/R ₆₄₀(p)),

where p is a specular pixel. Also, material-feature vectors for the specular pixels may tend to form one or more clusters. FIGS. 19A and 19B illustrate examples of two-dimensional projections of the three-dimensional material-feature space. The clusters of material-feature vectors are shown in these examples of two-dimensional projections.

Additionally, in block 1530, where the distance of a cluster of material-feature vectors from a reference material-feature vector (also referred to herein as a “feature vector”) is calculated to determine a material type, a reference feature vector may be obtained from physical measurements of the refractive index and the extinction coefficient. For example, a reference feature vector for aluminum can be a vector of the ratios of Fresnel reflectance at normal incidence (i.e., u=1): (F₅₃₂(1)/F₄₅₀(1),F₆₄₀(1)/F₅₃₂(1),F₈₀₈(1)I F₆₄₀(1)). The Fresnel reflectance, in this example, can in turn be calculated from a known refractive index and a known extinction coefficient at wavelengths of 450 nm, 532 nm, 640 nm, and 808 nm. A table of example reference feature vectors for some materials is shown below in Table 2:

TABLE 2 Reference Feature Vector Al 0.9942 0.9894 0.9560 Cu 1.1099 1.5214 1.0341 Cr 1.0029 0.9955 1.0267 Ni 1.1270 1.0902 1.0451

For example, some embodiments include a reference feature vector x₀ and a cluster C={x_(i)}_(i=1, 2, . . . ,K) of K material-feature vectors. The Euclidean distances ∥x_(i)−x₀∥, i=1, 2, . . . , K between the reference feature vector x₀ and the K material-feature vectors in the cluster C={x_(i)}_(i=1, 2, . . . , K) are sorted in ascending order of magnitude. Also, another threshold τ₂ is set. For example, in some embodiments τ₂=0.5. The distance function d(x₀,C) may be defined according to the following (where the reordering operation (permutation) that results from the sorting is denoted by σ):

d(x ₀ ,C)=mean {∥x _(σ(i)) −x ₀ ∥|i≦τ ₂·K}.

Thus, in these embodiments, the distance between a reference feature vector and a cluster is the average of the smallest τ₂·100% (e.g., 50% if τ₂=0.5) of the distances between the individual material-feature vectors in the cluster and the reference feature vector.

Table 3 shows an example of a distance matrix where each row corresponds to a cluster of material-feature vectors of a material sample. For example, the first row corresponds to an aluminum sample, the second row corresponds to a copper sample, the third row corresponds to a chromium sample, and the fourth row corresponds to a nickel sample. These clusters of material-feature vectors are classified against four possible material types, namely aluminum, copper, chromium, and nickel, by calculating the distance between the cluster and the reference feature vectors shown in the previous table. The smallest distance for each sample is highlighted. For each sample, the classification is correct.

TABLE 3

FIG. 20 illustrates an example embodiment of an operational flow for classifying materials. In block 2000, multispectral radiance images of a material sample that is illuminated by a coded pattern and an inverse coded pattern in N wavelengths λ are captured. In some embodiments, two stacks of mutually complementary images are captured, and each stack includes N images that correspond to the N wavelengths. Next, in block 2010, a radiance map is generated for each wavelength λ, for example as described in the description of block 1630 in FIG. 16. The flow then moves to block 2020, where a cluster of material-feature vectors is generated based on one or more of the radiance maps. Finally, in block 2030, the distances of the cluster of material-feature vectors from one or more reference feature vectors are calculated, and the material is classified based on the distances.

In block 2020, instead of using reflectance values to determine specular pixels, a threshold for radiance values is used to determine specular pixels. In some embodiments, this is done in two parts. In the first part, a threshold for radiance is used. This is similar to the threshold τ₀ and the determination of the binary mask M₁ described in the description of FIG. 16. After the application of the mask to the multispectral radiance images, only pixels that have a radiance that is above the threshold survive. Then, in the second part, a threshold similar to threshold τ₁ in the description of FIG. 16 is used to retain only pixels with radiance values in the top τ₁·100% range. The remaining pixels are then identified as specular.

Some of these embodiments may be advantageous, for example if the material sample has a very irregular shape or if accurately determining the surface normal vector is difficult. In these situations it may be advantageous to not determine the reflectance map, which depends on the irradiance map, which in turn depends on the surface normal map. However, because incident irradiance may not be accounted for by some embodiments, the specular pixels may simply have a high radiance and may not correspond to a truly specular reflection.

FIG. 21 illustrates an example embodiment of an arrangement of a camera 2110 and a projector 2120. In this example embodiment, the camera 2110 and the projector 2120 are arranged in a geometric configuration that induces a specular reflection at a gracing angle. In the illustrated arrangement, the observation angle is close to 90 degrees from the surface normal vector of a material sample 2100, in contrast to arrangements where the observation angle is closer to 0 degrees from the surface normal vector of the sample (some embodiments include both arrangements of the camera 2110 and the projector 2120).

This arrangement may be advantageous when, for example, discriminating aluminum and chromium without the use of an NIR wavelength (such as 808 nm). For example, consider the feature value R₅₃₂/R₄₅₀, which can be determined using visible wavelengths 450 nm and 532 nm. When measurements of this feature value are made at observation angles that are relatively close to the surface normal, the clusters for aluminum and chromium may not be reliably distinguished. However, feature-value measurements at gracing angles may distinguish these metals, as shown in FIG. 22, which illustrates examples of feature-value measurements for aluminum and chromium.

The measurements at near-surface-normal observation angles are shown near u=0.8 (which corresponds approximately to an observation angle of cos⁻¹(0.8))=37°. Also, clusters labeled A1 and C1 are sets of example clusters that correspond to measurements of an aluminum sample and a chromium sample that have identical surface-normal orientations. Clusters labeled A2 and C2 are another set of example clusters that correspond to measurements of an aluminum sample and a chromium sample that have identical surface-normal orientations as each other, but that are different from the first set of examples (so that the u values are different). These feature-value measurements may differentiate aluminum and chromium more easily than the feature-value measurements at near-surface-normal observation angles (e.g., near u=0.8).

For example, a set of feature-value measurements that correspond to cluster A1 have been made for a material sample, and the unknown material type is to be determined based on these measurements. The feature value of each point in the cluster, together with its corresponding u value (u is the cosine of half of the angle between the observation direction and the illumination direction), are determined. Based on the three-dimensional position of a pixel and on the positions of the centers of the projector and the camera, u can be determined, as shown in FIG. 23, which illustrates the positions that are used to calculate an incident angle and u. If v=cos(2θ) (obtained from the dot product of vectors, for example), then

u=cos θ=√{square root over ((v+1)/2)}.

The cluster A1 can be used to classify the material sample by finding the closest match to the R₅₃₂/R₄₅₀ feature-value theoretical curve (which is depicted in FIG. 4A). In this example, the cluster A1 matches the theoretical curve of aluminum better than the theoretical curve of chromium, so the material is classified as aluminum. The classification may be based on a distance function. For example, if C={(u_(i),x_(i))}_(i=1, 2, . . . K) represents a cluster such as A1, where N₁≦N−1, where x_(i) is a vector of N₁ ratios of measurements in different spectral bands (e.g., the ratios R₅₃₂/R₄₅₀/R₆₄₀/R₅₃₂, and the like); if C₀={(u_(i), x_(i))}_(i=1, 2, . . . , K) are reference feature values that depend on an angle, represented by its cosine u; and if {x_(i)}_(i=1, 2, . . . , K) are evaluated at the corresponding angular locations {u_(i)}_(i=1, 2, . . . , K), then the distance of the cluster C from the reference feature values C₀ may be defined as follows:

${d\left( {C,C_{0}} \right)} = {\frac{1}{K}{\sum\limits_{i = 1}^{K}\; {{{x_{i} - X_{i}}}.}}}$

FIG. 24 illustrates an example embodiment of an operational flow for classifying materials. This example embodiment does not determine the position map from the multispectral radiance images and instead obtains the position map from another source. The other source may be, for example, prior knowledge of the shape of a material sample, a structured light system, or a photometric stereo system. Block 2400 is identical to or similar to block 1500 of FIG. 15 or block 2000 of FIG. 20. In some embodiments, N is chosen to be relatively small, for example N=3. Such embodiments may be implemented with a relatively standard RGB projector (e.g., a multichannel projector that is an RGB projector) that has monochromatic channels, such as wavelengths of 450 nm, 532 nm, and 640 nm, and the camera can be a relatively standard RGB camera (e.g., the multispectral camera is an RGB camera). The coded pattern and its inverse pattern can be patterns that have relatively-high spatial frequencies (e.g., a checkerboard pattern). The same patterns may be used in each of the projector channels. Block 2410 is identical to or similar to block 2010 in FIG. 20. As described earlier, the use of relatively-high spatial-frequency patterns, mutually-inverse patterns, or complementary patterns produces two mutually complementary radiance images, which can be combined to correct interreflections (correcting interreflections may include determining the global component of the illumination). The operations in block 2420, which are similar or identical to the operations in block 1510 of FIG. 15, are not included in some embodiments. For example, the operations may be performed if the embodiment of the operational flow is similar to the embodiment of FIG. 15 or may be skipped if the embodiment of the operational flow is similar to the embodiment of FIG. 20.

When the operations in block 2420 are performed, they may be similar to the operations in the operational flow in FIG. 16, with the following differences: First, one or more radiance maps have already been generated in block 2410, so the operations may not include generating a radiance map based on multispectral radiance images, as performed in block 1630. Second, the position map is available from an external source, so the operations may not include generating of a position map based on multispectral radiance images, as performed in block 1600.

Next, block 2430 is identical to or similar to block 1520 in FIG. 15 or block 2020 in FIG. 20. The operations in block 2430 may also use the position map from the external source, for example when used in conjunction with the example embodiment of FIG. 23. Finally, block 2440 is identical to or similar to block 1530 in FIG. 15 or to block 2030 in FIG. 20. Some of these embodiments require only a relatively standard RGB projector for the projector, only a relatively standard RGB camera for the camera, and capturing only two RGB images.

FIG. 25 illustrates an example embodiment of an operational flow for classifying materials. This example embodiment also does not determine the position map from the multispectral radiance images, and instead obtains the position map from another source. Also, this embodiment does not use mutually inverse coded patterns, and the three-dimensional position information is obtained from a different source than spectral structured light. This may be particularly applicable when the shape of a sample is convex or when the interreflections of light are otherwise negligible. Also, in some embodiments of this operational flow, N is chosen to be relatively small, for example N=3. Such embodiments may be implemented with a relatively standard RGB projector (e.g., the multichannel projector is an RGB projector) that has monochromatic channels, such as wavelengths of 450 nm, 532 nm, and 640 nm, and the camera can be a relatively standard RGB camera (e.g., the multispectral camera is an RGB camera). In some of these embodiments, in block 2500, each pixel of the projector is turned on simultaneously to illuminate the sample, and the resulting scene is captured to produce a radiance map in N wavelengths. If N=3, this is an RGB radiance image. Block 2510 is identical to or similar to block 2420 in FIG. 24 or to block 1510 of FIG. 15. Block 2520 is identical to or similar to block 2430 in FIG. 24, block 1520 in FIG. 15, or block 2020 in FIG. 20. Finally block 2530 is identical to or similar to block 2440 in FIG. 24, block 1530 in FIG. 15, and block 2030 in FIG. 20. Some of these embodiments also require only a relatively standard RGB projector for the projector, only a relatively standard RGB camera for the camera, and capturing only one RGB image.

Some of the embodiments of the systems, methods, and devices that are described herein may be combined. For example, some embodiments include multiple cameras at different observation angles, some of which may perform observation at a normal direction and some of which may perform observation at a gracing angle, and which may be arranged around the sample to simultaneously perform observation of the sample. Also, in some embodiments one or more cameras are moved to different angles at different times. Similarly, some embodiments include multiple projectors that provide illumination from different illumination angles, and some embodiments include one or more projectors that move to different illumination angles at different times.

The above-described devices, systems, and methods can be implemented by providing one or more computer-readable media that contain computer-executable instructions for realizing the above-described operations to one or more computing devices that are configured to read and execute the computer-executable instructions. Thus, the systems or devices perform the operations of the above-described embodiments when executing the computer-executable instructions. Also, an operating system on the one or more systems or devices may implement at least some of the operations of the above-described embodiments. Thus, the computer-executable instructions or the one or more computer-readable media that contain the computer-executable instructions constitute an embodiment.

Any applicable computer-readable medium (e.g., a magnetic disk (including a floppy disk, a hard disk), an optical disc (including a CD, a DVD, a Blu-ray disc), a magneto-optical disk, a magnetic tape, and semiconductor memory (including flash memory, DRAM, SRAM, a solid state drive, EPROM, EEPROM)) can be employed as a computer-readable medium for the computer-executable instructions. The computer-executable instructions may be stored on a computer-readable storage medium that is provided on a function-extension board inserted into a device or on a function-extension unit connected to the device, and a CPU provided on the function-extension board or unit may implement at least some of the operations of the above-described embodiments.

The scope of the claims is not limited to the above-described embodiments and includes various modifications and equivalent arrangements. Also, as used herein, the conjunction “or” generally refers to an inclusive “or,” though “or” may refer to an exclusive “or” if expressly indicated or if the context indicates that the “or” must be an exclusive “or.” 

What is claimed is:
 1. A method for classifying a sample by material type, the method comprising: measuring a reflection of a sample at an illumination angle and an observation angle in at least two spectral bands; calculating a feature value for the sample based on an estimated ratio value of the at least two spectral bands of the measured reflection; and classifying the sample based on the feature value.
 2. The method of claim 1, wherein the reflection of the sample is a specular reflection of the sample.
 3. The method of claim 2, wherein measuring the specular reflection includes generating a measurement of a bidirectional reflectance distribution function.
 4. The method of claim 2, wherein measuring the specular reflection includes generating a measurement of reflected radiance.
 5. The method of claim 1, wherein the feature value is further based on a Fresnel reflectance of the measured reflection.
 6. The method of claim 1, wherein classifying the sample based on the feature value includes matching the feature value with a predetermined database of reference feature values for different material types.
 7. The method of claim 1, wherein the sample is a metal sample.
 8. The method of claim 1, wherein the spectral bands are each a single wavelength.
 9. The method of claim 8, wherein the single wavelengths include one or more of 450 nanometers, 532 nanometers, 640 nanometers, and 808 nanometers.
 10. The method of claim 1, wherein the spectral bands are each a broadband.
 11. The method of claim 1, wherein the spectral bands include one or more of a visible range of a light spectrum and a near-infrared range of the light spectrum.
 12. The method of claim 11, wherein the near-infrared range includes a proximity of a wavelength of 816 nanometers.
 13. A system for classifying a sample by material type, the system comprising: one or more computer-readable media; and one or more processors that are coupled to the one or more computer-readable media and that are configured to cause the system to measure a reflection of a sample at an illumination angle and an observation angle in at least two spectral bands, calculate a feature value for the sample based on an estimated ratio value of the at least two spectral bands of the reflection of the sample, and classify the sample based on the feature value.
 14. The system of claim 13, wherein the one or more processors are further configured to cause the system to calculate two or more different feature values; and classify the sample using a multi-dimensional feature space composed of the feature value and the two or more different feature values.
 15. The system of claim 13, further comprising one or more multi-channel projectors; and one or more multispectral cameras, wherein the one or more processors are further configured to cause the system to illuminate the sample using the one or more multi-channel projectors, and observe the sample using the one or more multispectral cameras, and wherein to measure the reflection, the one or more processors are configured to cause the system to capture images of the sample using the one or more multispectral cameras while the sample is illuminated by the one or more multi-channel projectors.
 16. The system of claim 15, wherein at least one multi-channel projector of the one or more multi-channel projectors is positioned relatively close to the sample, and wherein at least one multispectral camera of the one or more multispectral cameras is positioned relatively far from the sample.
 17. The system of claim 15, wherein at least one multi-channel projector of the one or more multi-channel projectors is positioned relatively far from the sample, and wherein at least one multispectral camera of the one or more multispectral cameras is positioned relatively close to the sample.
 18. The system of claim 15, wherein at least one multi-channel projector of the one or more multi-channel projectors is configured to project a coded pattern in two or more spectral channels, and at least one multispectral camera of the one or more multispectral cameras is configured to capture the coded pattern in each of the two or more spectral channels.
 19. The system of claim 18, wherein a spatial frequency of the coded patterns in the two or more spectral channels is different in each channel.
 20. The system of claim 18, wherein the at least two spectral bands of the reflection of the sample correspond to the two or more spectral channels with coded patterns, and wherein the spatial frequencies of the coded patterns can be resolved by at least one multispectral camera of the one or more multispectral cameras.
 21. The system of claim 13, wherein to classify the sample based on the feature value, the one or more processors are configured to cause the system to match the feature value with one or more entries in a predetermined database of reference feature values for different material types, wherein the predetermined database of reference feature values includes a dependence on one or more of the illumination angle and the observation angle.
 22. The system of claim 21, wherein the one or more processors are further configured to cause the system to measure the specular reflection and calculate the feature value for multiple surface points of the sample, and form the multiple feature values for the multiple surface points of the sample into a cluster.
 23. The system of claim 22, wherein the one or more processors are further configured to classify the sample based on a calculated distance of the cluster from each of one or more reference feature values in a predetermined database of reference feature values, and wherein a match corresponds to a shortest distance.
 24. A method of classifying a sample by material type, the method comprising: capturing an image of a sample at an observation angle, wherein the sample is illuminated at an illumination angle in at least two spectral bands; measuring a respective reflection for each of a plurality of pixels in the image of the sample; calculating a respective feature value for each pixel based on a ratio value, wherein the ratio value is based on the at least two spectral bands of the reflection of the pixel; and classifying the sample based on the feature values.
 25. The method of claim 24, wherein the illumination angle and the observation angle are relatively small angles, and the reflection occurs at a relatively small incidence angle.
 26. The method of claim 24, wherein the illumination angle and the observation angle are relatively large angles, and the reflection occurs at a grazing incidence angle.
 27. The method of claim 24, wherein the ratio value is a ratio of measurements in different spectral bands.
 28. The method of claim 24, wherein the ratio value is a ratio of measurement in a first spectral band to the geometric mean of measurements in different spectral bands. 